import os
import random

def make_dir(path):
    if not os.path.exists(path):
        os.makedirs(path)

    filename = ''
    lst = ['蔬菜','电器','生鲜','水果']
    for num in range(1,1000):
        if num <10:
            filename = '000' + str(num) + '_' + random.choice(lst) + '.txt'
        elif num <100:
            filename = '00' + str(num) + '_' + random.choice(lst) + '.txt'
        else:
            filename = '0' + str(num) + '_' + random.choice(lst) + '.txt'
        os.makedirs(os.path.join(path,filename))

if __name__ == '__main__':
    path = '.\\0001_蔬菜'
    make_dir(path)